#ifndef KERNEL_H
#define KERNEL_H
#include "dt.h"
#include "it.h"
#ifdef DEBUG_INFO
#define kdbginfo kdebugf("%s:%s:%u:", __FILE__, __FUNCTION__, __LINE__); kdebugf
#else
#define kdbginfo kdebugf_null
#endif
#ifdef DEBUG_WARN
#define kdbgwarn kdebugf("%s:%s:%u:", __FILE__, __FUNCTION__, __LINE__); kdebugf
#else
#define kdbgwarn kdebugf_null
#endif
#ifdef DEBUG_ERROR
#define kdbgerror kdebugf("%s:%s:%u:", __FILE__, __FUNCTION__, __LINE__); kdebugf
#else
#define kdbgerror kdebugf_null
#endif
#include "debug.h"

/// kernel interrupt descriptor table
extern titr *g_k_idt;
extern tdtr *g_k_gdt;
extern uint32_t *g_k_vmd;

/// start and end of kernel image, with binary sixteen bit code section start.
extern unsigned char __end;
extern unsigned char __start;
extern unsigned char __b16code;

#define KERNEL_CRITICAL_ENTER asm("cli")
#define KERNEL_CRITICAL_EXIT asm("sti")
#endif

